package com.peanut.boot.controller.sutdent;

import com.peanut.boot.entiity.Student;
import com.peanut.boot.service.student.IStudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @className: com.peanut.boot.controller.sutdent-> sudentController
 * @description: 这个类是做做什么得吖，小朋友？
 * @author: chenhs
 * @createDate: 2021-12-01 21:42
 * @version: 1.0
 */
@Controller
public class SudentController {
    @Autowired
    private JdbcTemplate jdbcTemplate;

    @Autowired
    private IStudentService studentService;
    //xml配置方式
    @ResponseBody
    @GetMapping(value = "/getNoteStudentlist")
    public List<Student> getNoteStudentlist(@RequestParam("id") Long id) {
        return studentService.getNoteStudentList(id);
    }
    //    注解方式
    @ResponseBody
    @GetMapping(value = "/getStudentlist")
    public List<Student> getStudentlist(@RequestParam("id") Long id) {
        return studentService.getStudentList(id);
    }
}
